<!DOCTYPE html>
<html>

    <head>
        <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/2.0.3/socket.io.js"></script>
    </head>

    <body>
        <div id='trade'> open console </div>
    </body>

    <script type="text/javascript">

        var socket = io.connect('https://coincap.io');

        socket.on('trades', function (tradeMsg) {
            console.log(tradeMsg);
            document.getElementById('trade').innerHTML = JSON.stringify(tradeMsg)
        })

    </script>

</html>


